package valueobject

import "github.com/lab-online/pkg/auth"

func (u *User) GetName() string {
	return u.Name
}

func (u *User) GetUsername() string {
	return u.Username
}

func (u *User) GetRole() uint {
	return u.Role
}

func (u *User) IsIncludeRole(role auth.Role) bool {
	return u.Role&uint(role) != 0
}

func (u *User) IsAdmin() bool {
	return u.IsIncludeRole(auth.RoleAdmin)
}

func (u *User) IsTeacher() bool {
	return u.IsIncludeRole(auth.RoleTeacher)
}

func (u *User) IsStudent() bool {
	return u.IsIncludeRole(auth.RoleStudent)
}
